// Pipeline Component Library Example
// ----------------------------------
// Colin Bowern (colinbowern@hotmail.com)
// January 2007
//
// Copyright (c) 2007 Colin Bowern
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// * The above copyright notice and this permission notice shall be included in
//   all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#region References
using Microsoft.CommerceServer.Runtime;
using Microsoft.CommerceServer.Runtime.Orders;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
#endregion

namespace RockstarGuys.Pipelines.Tests
{
    /// <summary>
    /// Test class for the Total pipeline.
    /// </summary>
    [TestClass]
    public class TotalTest
    {
        #region Class Initialization
        [ClassInitialize]
        /// <remarks>
        /// When developing on Windows Vista you will likely need Administrative privileges
        /// until Commerce Server 2007 Service Pack 1 ships. Running this method as a
        /// normal user appears to hang a majority of the time because of some issue in the
        /// COM+ layer.
        /// </remarks>
        public static void ClassInitialize(TestContext context)
        {
            // HACK Visual Studio doesn't execute test setup scripts when running a local test and
            // HACK it doesn't deploy satellite assemblies properly.
            ProcessStartInfo processStartInfo = new ProcessStartInfo(@"..\QTSetup.bat");
            processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            processStartInfo.UseShellExecute = true;
            using(Process process = Process.Start(processStartInfo))
            {
                process.WaitForExit();
            }

            OrderContext.Create(Helper.SiteName);
        }
        #endregion

        #region RunPipeline
        /// <summary>
        /// Positive: Empty order
        ///</summary>
        [TestMethod]
        public void TotalTest1()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
        }

        /// <summary>
        /// Positive: One item, no taxes to apply
        ///</summary>
        [TestMethod]
        public void TotalTest2()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "US";
            target.Addresses[0].RegionCode = "WA";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(decimal.Zero, target.TaxTotal);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: One item, country taxes to apply
        ///</summary>
        [TestMethod]
        public void TotalTest3()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "CA";
            target.Addresses[0].RegionCode = "BC";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(0.67M, target.TaxTotal);
            Assert.AreEqual<decimal>(0.07M, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(0.60M, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: One item and shipment, country/region taxes apply
        ///</summary>
        [TestMethod]
        public void TotalTest4()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "CA";
            target.Addresses[0].RegionCode = "ON";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(1.57M, target.TaxTotal);
            Assert.AreEqual<decimal>(0.17M, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(1.40M, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: Multiple items, no taxes
        /// </summary>
        [TestMethod]
        public void TotalTest5()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "US";
            target.Addresses[0].RegionCode = "WA";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD002", null, 1.0M));
            target.OrderForms[0].LineItems[1].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[1].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[1].ListPrice = 2.34M;
            target.OrderForms[0].LineItems[1].ExtendedPrice = 2.34M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(decimal.Zero, target.TaxTotal);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[1][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: Multiple items, country/region taxes apply
        /// </summary>
        [TestMethod]
        public void TotalTest6()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "CA";
            target.Addresses[0].RegionCode = "ON";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD002", null, 1.0M));
            target.OrderForms[0].LineItems[1].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[1].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[1].ListPrice = 2.34M;
            target.OrderForms[0].LineItems[1].ExtendedPrice = 2.34M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(1.90M, target.TaxTotal);
            Assert.AreEqual<decimal>(0.17M, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(0.33M, (decimal)target.OrderForms[0].LineItems[1][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(1.40M, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: Multiple items, mixed set of taxes apply
        /// </summary>
        [TestMethod]
        public void TotalTest7()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "CA";
            target.Addresses[0].RegionCode = "ON";

            target.Addresses.Add(new OrderAddress());
            target.Addresses[1].Name = target.Addresses[1].OrderAddressId;
            target.Addresses[1].CountryCode = "CA";
            target.Addresses[1].RegionCode = "BC";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD002", null, 1.0M));
            target.OrderForms[0].LineItems[1].ShippingAddressId = target.Addresses[1].OrderAddressId;
            target.OrderForms[0].LineItems[1].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[1].ListPrice = 2.34M;
            target.OrderForms[0].LineItems[1].ExtendedPrice = 2.34M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "Total", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(2.31M, target.TaxTotal);
            Assert.AreEqual<decimal>(0.17M, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(0.14M, (decimal)target.OrderForms[0].LineItems[1][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(1.40M, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(0.60M, (decimal)target.OrderForms[0].Shipments[1][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: Multiple items, country/region taxes apply, line item tax exemption
        /// </summary>
        [TestMethod]
        public void TotalTest8()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "CA";
            target.Addresses[0].RegionCode = "ON";

            target.Addresses.Add(new OrderAddress());
            target.Addresses[1].Name = target.Addresses[1].OrderAddressId;
            target.Addresses[1].CountryCode = "CA";
            target.Addresses[1].RegionCode = "BC";

            target.Addresses.Add(new OrderAddress());
            target.Addresses[2].Name = target.Addresses[2].OrderAddressId;
            target.Addresses[2].CountryCode = "US";
            target.Addresses[2].RegionCode = "WA";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD002", null, 1.0M));
            target.OrderForms[0].LineItems[1].ShippingAddressId = target.Addresses[1].OrderAddressId;
            target.OrderForms[0].LineItems[1].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[1].ListPrice = 2.34M;
            target.OrderForms[0].LineItems[1].ExtendedPrice = 2.34M;
            target.OrderForms[0].LineItems[1]["country_tax_exempt"] = true;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD003", null, 1.0M));
            target.OrderForms[0].LineItems[2].ShippingAddressId = target.Addresses[2].OrderAddressId;
            target.OrderForms[0].LineItems[2].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[2].ListPrice = 3.45M;
            target.OrderForms[0].LineItems[2].ExtendedPrice = 3.45M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "TotalLineItemTaxExemption", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(2.17M, target.TaxTotal);
            Assert.AreEqual<decimal>(0.17M, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[1][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[2][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(1.40M, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(0.60M, (decimal)target.OrderForms[0].Shipments[1][PipelineComponents.Shipment.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].Shipments[2][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }

        /// <summary>
        /// Positive: Multiple items, country/region taxes apply, order level tax exemption
        /// </summary>
        [TestMethod]
        public void TotalTest9()
        {
            Basket target = OrderContext.Current.GetBasket(Guid.NewGuid());

            target.Addresses.Add(new OrderAddress());
            target.Addresses[0].Name = target.Addresses[0].OrderAddressId;
            target.Addresses[0].CountryCode = "CA";
            target.Addresses[0].RegionCode = "ON";

            target.Addresses.Add(new OrderAddress());
            target.Addresses[1].Name = target.Addresses[1].OrderAddressId;
            target.Addresses[1].CountryCode = "CA";
            target.Addresses[1].RegionCode = "BC";

            target.Addresses.Add(new OrderAddress());
            target.Addresses[2].Name = target.Addresses[2].OrderAddressId;
            target.Addresses[2].CountryCode = "US";
            target.Addresses[2].RegionCode = "WA";

            target.OrderForms.Add(new OrderForm(OrderForm.DefaultOrderFormName));

            target.OrderForms[0]["country_tax_exempt"] = true;
            target.OrderForms[0]["region_tax_exempt"] = true;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD001", null, 1.0M));
            target.OrderForms[0].LineItems[0].ShippingAddressId = target.Addresses[0].OrderAddressId;
            target.OrderForms[0].LineItems[0].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[0].ListPrice = 1.23M;
            target.OrderForms[0].LineItems[0].ExtendedPrice = 1.23M;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD002", null, 1.0M));
            target.OrderForms[0].LineItems[1].ShippingAddressId = target.Addresses[1].OrderAddressId;
            target.OrderForms[0].LineItems[1].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[1].ListPrice = 2.34M;
            target.OrderForms[0].LineItems[1].ExtendedPrice = 2.34M;

            target.OrderForms[0].LineItems.Add(new LineItem("CATALOG", "PROD003", null, 1.0M));
            target.OrderForms[0].LineItems[2].ShippingAddressId = target.Addresses[2].OrderAddressId;
            target.OrderForms[0].LineItems[2].ShippingMethodId = (Guid)OrderContext.Current.GetShippingMethods().Tables[0].Rows[0]["ShippingMethodId"];
            target.OrderForms[0].LineItems[2].ListPrice = 3.45M;
            target.OrderForms[0].LineItems[2].ExtendedPrice = 3.45M;

            PipelineExecutionResult expected = PipelineExecutionResult.Success;

            PipelineExecutionResult actual = Helper.RunPipeline(target, "TotalOrderFormTaxExemption", OrderPipelineType.Total);
            Assert.AreEqual<PipelineExecutionResult>(expected, actual);
            Assert.AreEqual<decimal>(decimal.Zero, target.TaxTotal);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[0][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[1][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].LineItems[2][PipelineComponents.LineItem.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].Shipments[0][PipelineComponents.Shipment.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].Shipments[1][PipelineComponents.Shipment.KeyNames.TaxTotal]);
            Assert.AreEqual<decimal>(decimal.Zero, (decimal)target.OrderForms[0].Shipments[2][PipelineComponents.Shipment.KeyNames.TaxTotal]);
        }
        #endregion
    }
}
